Attribute VB_Name = "Module1"
'= Rohde&Schwarz Directional Power Sensor NRT-Z ===========================

'===========================================================================
'  Please do not use global variables or arrays in the include file of
'  instrument drivers that will be submitted for inclusion into the
'  LabWindows Instrument Driver Library.
'===========================================================================

'***************************************************************************
'= Multiplatform support defines ===========================================
'
'  Note that improper platform preprocessor directive may cause unexpected
'  behaviour of the driver functions.
'
'***************************************************************************

Global Const CLOCKS_PER_SEC = 1000&

'***************************************************************************
'= Define Instrument Specific Error/Warning Codes Here =====================
'***************************************************************************
Global Const VI_INSTR_ERROR_OFFSET = &HBFFC0900
Global Const VI_INSTR_WARNING_OFFSET = &H3FFC0900

Global Const VI_ERROR_INSTR_INTERPRETING_RESPONSE = &HBFFC0803

Global Const RSNRTZ_ERROR_INVALID_CONFIGURATION = &HBFFC09F0
Global Const RSNRTZ_ERROR_INSTR_RESET = &HBFFC0910
Global Const RSNRTZ_ERROR_INSTR_ZERO = &HBFFC0920
Global Const RSNRTZ_ERROR_INSTR_MEAS_STAT = &HBFFC0930
Global Const RSNRTZ_ERROR_NSUP_INTERFACE = &HBFFC0940
Global Const RSNRTZ_ERROR_INSTR_SENSOR_BUSY = &HBFFC0950
Global Const RSNRTZ_ERROR_INSTR_ERROR_RANGE = &HBFFC0960

Global Const RSNRTZ_PARITY = 0&

'***************************************************************************
'= GLOBAL USER-CALLABLE FUNCTION DECLARATIONS (Exportable Functions) =======
'***************************************************************************
Declare Function rsnrtz_init Lib "rsnrtz_32.dll" (ByVal resourceName As String, ByVal IDQuery As Integer, ByVal resetDevice As Integer, instrumentHandle As Long) As Long
Declare Function rsnrtz_applMeasPower Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, forwardAveragePowerW As Double, reflectedPowerW As Double) As Long
Declare Function rsnrtz_configBurst Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal burstPeriods As Double, ByVal burstWidths As Double, oldBurstPeriods As Double, oldBurstWidths As Double) As Long
Declare Function rsnrtz_configCCDF Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal CCDFThresholdW As Double, oldCCDFThresholdW As Double) As Long
Declare Function rsnrtz_configDir Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal direction As Integer, oldDirection As Integer) As Long
Declare Function rsnrtz_configCarrFreq Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal carrierFrequencyHz As Double, oldCarrierFrequencyHz As Double) As Long
Declare Function rsnrtz_configAver Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal averagingMode As Integer, ByVal averagingFilterCount As Integer, ByVal averagingResolution As Integer, averagingFilterCountOld As Integer, averagingResolutionOld As Integer) As Long
Declare Function rsnrtz_configIntTime Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal integrationTimes As Double, oldIntegrationTimes As Double) As Long
Declare Function rsnrtz_configVideoBW Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal videoBandwidth As Integer, ByVal spreadSpectrumSignal As Integer, oldVideoBandwidth As Double, oldSpreadSpectrumSignal As Integer) As Long
Declare Function rsnrtz_configHoldTime Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal holdTimes As Double, oldHoldTimes As Double) As Long
Declare Function rsnrtz_configRefPlane Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal referencePlane As Integer, oldReferencePlane As Integer) As Long
Declare Function rsnrtz_configMeas Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal statusCheck As Integer, ByVal readResults As Integer, oldStatusCheck As Integer, oldReadResults As Integer) As Long
Declare Function rsnrtz_configMod Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal chipRate1s As Double, ByVal communicationStandard As Integer, oldChipRate As Double, oldCommunicationStandard As Integer) As Long
Declare Function rsnrtz_configAttn Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal attenuationdB As Double, oldAttenuation As Double) As Long
Declare Function rsnrtz_configBoot Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long) As Long
Declare Function rsnrtz_configPurge Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long) As Long
Declare Function rsnrtz_configQueryOpMode Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, operatingMode As Integer) As Long
Declare Function rsnrtz_configHWTestPts Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, limitsLow As Double, measuredValues As Double, limitsHigh As Double) As Long
Declare Function rsnrtz_actstatFwdMeasMode Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal forwardMeasMode As Integer, oldForwardMeasMode As Integer) As Long
Declare Function rsnrtz_actstatRevMeasMode Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal reverseMeasMode As Integer, oldReverseMeasMode As Integer) As Long
Declare Function rsnrtz_actstatZero Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal zeriong As Integer, forwardOffsetV As Double, reverseOffsetV As Double, PEPZero4kHzV As Double, PEPZero200kHzV As Double, PEPZero4MHzV As Double) As Long
Declare Function rsnrtz_actstatMeas Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal trigger As Integer, forwardValue As Double, reversValue As Double) As Long
Declare Function rsnrtz_actstatMeasWithStat Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal trigger As Integer, forwardValue As Double, reversValue As Double, error As Integer, limit As Integer, forwardFunction As Integer, reverseFunction As Integer, forwardPowerDirection As Integer, averagePowFwdFilter As Integer, averagePowRevFilter As Integer, PEPFilter As Integer, distributionFunctionFilter As Integer) As Long
Declare Function rsnrtz_actstatMeasNoise Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, vpp1V As Double, vpp2V As Double, noise1 As Double, noise2 As Double) As Long
Declare Function rsnrtz_actstatMeasOffs Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, filter1OffsetV As Double, filter2OffsetV As Double) As Long
Declare Function rsnrtz_dataStatusTxt Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal statusParameter As Integer, ByVal statusText As String, numberOfBytesRead As Long) As Long
Declare Function rsnrtz_writeInstrData Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal writeBuffer As String) As Long
Declare Function rsnrtz_readInstrData Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal numberBytesToRead As Long, ByVal readBuffer As String, numBytesRead As Long) As Long
Declare Function rsnrtz_reset Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long) As Long
Declare Function rsnrtz_self_test Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, selfTestResult As Integer, ByVal selfTestMessage As String) As Long
Declare Function rsnrtz_error_query Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, errorCode As Long, ByVal errorMessage As String) As Long
Declare Function rsnrtz_error_message Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, statusCode As Long, ByVal message As String) As Long
Declare Function rsnrtz_revision_query Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long, ByVal instrumentDriverRevision As String, ByVal firmwareRevision As String) As Long
Declare Function rsnrtz_close Lib "rsnrtz_32.dll" (ByVal instrumentHandle As Long) As Long

'***************************************************************************
'=== END INCLUDE FILE ======================================================
'***************************************************************************

